package io.renren.service.impl;

import io.renren.utils.Query;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.dao.WxuserDao;
import io.renren.entity.WxuserEntity;
import io.renren.service.WxuserService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * describe:
 * create @ kylin  2019/02/27
 */
@Service("wxuserService")
public class WxuserServiceImpl extends ServiceImpl<WxuserDao, WxuserEntity> implements WxuserService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<WxuserEntity> page = this.page(
                new Query<WxuserEntity>().getPage(params),
                new QueryWrapper<WxuserEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public WxuserEntity selectOpenIdIsExist(String openid) throws Exception {
        return this.baseMapper.selectOpenIdIsExist(openid);
    }

    @Override
    public Integer insertSelective(WxuserEntity wxuserEntity) throws Exception {
        return this.baseMapper.insertSelective(wxuserEntity);
    }

    @Override
    public Integer updateInfo(WxuserEntity wxuserEntity) throws Exception {
        return this.baseMapper.updateInfo(wxuserEntity);
    }

    @Override
    public String RtnWxStuUuid(String openid) throws Exception {
        return this.baseMapper.RtnWxStuUuid(openid);
    }

}
